StringScanner.GetLineText Function

Syntax

Text as C = GetLineText as C([lineNumer as n])

Arguments

Text

The text contents of a line.

lineNumer

Optional. Default = current line. The number of a line in the StringScanner buffer.

Description

Return the text of the line we are on, if optional requested line is set, we go to the begginning of the specified line first.

Discussion

The <StringScanner>.GetLineText() function retrieves the text of the current line or of any specified line in the StringScanner buffer. Lines are defined by CR-LF.

Example

dim scanner as StringScanner
dim txt as C
txt = <<%text%
This is line one
and this is line two
and finally line three
%text%
scanner = stringscanner.Create(txt)
? scanner.ScanOver(24)
= This is line one
and th
? scanner.GetLineText()
= "and this is line two"
? scanner.GetLineText(3)
= "and finally line three"

See Also